using System;
using PhillyCodeCamp.Domain.Validation;

namespace PhillyCodeCamp.DTO
{
    public class SmartDTO : ISmartDTO
    {
        private readonly IBusinessRuleSet _rules = new BusinessRuleSet<SmartDTO>();

        public SmartDTO()
        {
            _rules.AddAttributeValidationRules(this);
        }


        public IBusinessRuleSet Validate()
        {
            return _rules.BrokenBy(this);
        }

        public bool IsValid
        {
            get { return Validate().IsEmpty; }
        }
    }
}